package com.syx.utils;


import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.sex.spring.model.User;
import com.sex.spring.service.UserService;

public class UserText {

	//UserService userService = new UserServiceImpl();
	ApplicationContext atx = null;
	UserService userService = null;
	@Before
	public void init(){
		atx = new ClassPathXmlApplicationContext("spring-beans.xml");
		userService = (UserService) atx.getBean("userServiceImpl");
	}
	@Test
	public void test() {
		User user = new User();
		user.setUserId(1);
		user.setPassword("123456");
		user.setUserName("张三");
		userService.addUser(user);
	}

}
